package top.kaoshanji.p2ch10a.support;

/**
 * author kaoshanji
 * ^_^
 * create time 2025/2/2 20:08
 */
public class ToBeCloned implements Cloneable {

    public ToBeCloned() {
        System.out.println("构造方法被调用。");
    }

    private int value = 0;

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public Object clone() {
        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            throw new Error(e);
        }
    }
}
